﻿using System.Collections.Generic;

namespace IOA.MES.DataAccess.VModel
{
    /// <summary>
    /// 结转单
    /// </summary>
    public class VCarryOverOrder : BaseVModel
    {
        private string _orderNo = string.Empty;
        private string _carryoverno = string.Empty;
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _fromWorkOrderNo = string.Empty;
        private string _toWorkOrderNo = string.Empty;

        #region Public Property

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string CarryOverNo
        {
            get { return string.IsNullOrWhiteSpace(_carryoverno) ? string.Empty : _carryoverno; }
            set { _carryoverno = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 结转工单
        ///</Summary>
        public string FromWorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_fromWorkOrderNo) ? string.Empty : _fromWorkOrderNo; }
            set { _fromWorkOrderNo = value; }
        }

        ///<Summary>
        /// 接收工单
        ///</Summary>
        public string ToWorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_toWorkOrderNo) ? string.Empty : _toWorkOrderNo; }
            set { _toWorkOrderNo = value; }
        }

        ///<Summary>
        /// 结转单状态
        ///</Summary>
        public Enum.CarryOverOrderStatus Status { get; set; }
        public string CNStatus { get { return !System.Enum.IsDefined(typeof(Enum.CarryOverOrderStatus), Status) ? string.Empty : EnumConvert.ToDesc(Status); } }

        public string CNCreatedBy { get; set; }

        public string CNCreatedTime { get
            {
                return this.CreateTime.ToString("yyyy-MM-dd HH:mm");
            }
        }

        /// <summary>
        /// 结转单产品列表
        /// </summary>
        public List<VCarryOverProduct> Products { get; set; } = new List<VCarryOverProduct>();
        #endregion
    }
}
